<!DOCTYPE HTML>

<html ng-app lang="en">

{{>/head}}

<div class="container" >
		<!-- ========================================================================================================= row1 (title) -->
		<div class="row">
            <center><h1 class="logoBigText"><span class="vcu">new</span>Platform</h1></center>
        </div>
        <!-- ========================================================================================================= /row1 (title) -->

        <!-- ========================================================================================================= row2 (New Platform Form) -->
        <div class="row">
			<div class="col-md-3"></div>

			<form ng-submit='creatNewPlatform()'  ng-controller="platformController" name="newPlatformForm" class="col-md-6" novalidate>

                <!-- ========================================================================================================= Platform ID Input -->
				<p class="motto">new.Platform ID:</p>

				<div class="form-group">
					<input type="text" placeholder="Platform ID" name="PlatformId" ng-model="platform.platformId" class="form-control" required>
				</div>
				<!-- ========================================================================================================= /Platform ID Input -->

				<!-- ========================================================================================================= Platform Name Input -->
                <p class="motto">new.Platform Name:</p>
				<div class="form-group">
					<input type="text" placeholder="Platform Name" name="PlatformName" ng-model="platform.platformName" class="form-control" required>
				</div>
                <!-- ========================================================================================================= /Platform Name Input -->

                <!-- ========================================================================================================= Platform Description Input -->
                <div class="form-group">
                    <p class="motto">new.Platform Description:</p>
                    <textarea class="form-control"
                        type="text"
                        name="PlatformDescription"
                        placeholder="Platform Description"
                        ng-model="platform.Description"
                        rows="10"> </textarea>
                </div>
                <!-- ========================================================================================================= /Platform Description Input -->

                <!-- ========================================================================================================= ValidationBlock -->
                <div class="alert alert-warning"
                        class="help-block"
                        ng-show="newPlatformForm.$invalid">
                    <li ng-show="newPlatformForm.PlatformId.$error.required">Please enter a name for the new Platform.</li>
                </div>
                <!-- ========================================================================================================= /ValidationBlock -->

                <!-- ========================================================================================================= AdminPanel -->
                <div class="alert alert-warning">

                    {{=[[ ]]=}}


                         <p>Admin Panel:</p>
                         <pre>{{platform | json}}</pre>


                     [[={{ }}=]]
                </div>
                <!-- ========================================================================================================= /AdminPanel -->

                <!-- ========================================================================================================= Reset and Submit Buttons -->
                <center>

                    <button ng-click="reset()" type="reset" class="btn btn-primary">Reset</button>
                    <button
                        type="submit"
                        ng-click="update(platform)"
                        ng-disabled="newPlatformForm.$invalid"
                        class="btn btn-success" >Submit Platform
                    </button>


                    <!-- <div class="row">
                        <p>Platform Created on:  {{p_front}}'1288323623006' | date:'MM/dd/yyyy, h:mma' {{p_back}}</p>
                    </div> -->
                </center>
                <!-- ========================================================================================================= /Reset and Submit Buttons -->




			</form><!--/Login Form-->



			<!-- ========================================================================================================= /newPlatformForm -->

			<div class="col-md-3"></div>

		</div><!--/row-->
		<!-- ========================================================================================================= /new.platform -->
	</div> <!--/container-->



{{>/foot}}

	<!--Temporary Inline script-->
	<script type="text/javascript">

	function platformController($scope, $http) {
		$scope.master= {};
		$scope.platform= {};
		$scope.output= {};
		$scope.submitURL="/registerplatform";
		$scope.update = function(platform) {

			$scope.master= angular.copy(platform);
			$http.post($scope.submitURL, $scope.master).success(function(data){
				$scope.master={};
				window.location.href=window.location.href;
				});
		}
		$scope.reset = function() {
			$scope.user = angular.copy($scope.master);
			$scope.form.$setPristine();
		};
	}</script>

</html>